﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CubicFWNet.Data.Models
{
    public partial class Purchase
    {
        public System.Guid Id { get; set; }
        public string Number { get; set; }
        /// <summary>
        /// 1:填写采购单（等待分类） 6：采购 7：已合并 8:单独采购 -1：生产
        /// </summary>
        public int Status { get; set; }
        /// <summary>
        /// 1.订单产品外购 2.自定义采购
        /// </summary>
        public int Type { get; set; }
        public Nullable<System.Guid> SupplierId { get; set; }
        public Nullable<System.Guid> CreatorId { get; set; }
        public string CreatorName { get; set; }
        public Nullable<System.DateTime> CreateTime { get; set; }
        public System.DateTime ApplyTime { get; set; }
        public Nullable<System.Guid> ApplyId { get; set; }
        public string Data { get; set; }
        [DisplayName("采购数量")]
        public decimal Amount { get; set; }
        [DisplayName("成本价格")]
        public decimal CostPrice { get; set; }
        public decimal ActualPrice { get; set; }
        public string Memo { get; set; }
        /// <summary>
        /// 到货日期
        /// </summary>
        public Nullable<System.DateTime> ArrivalTime { get; set; }
        /// <summary>
        /// 到货数量
        /// </summary>
        public decimal ArrivalAmount { get; set; }
        /// <summary>
        /// 采购产品名称
        /// </summary>
        public string PurchaseName { set; get; }
        /// <summary>
        ///  采购产品名称Id
        /// </summary>
        public Nullable<System.Guid> PurchaseNameId { get; set; }

        //[NotMapped]
        //public string StatusStr
        //{
        //    get
        //    {
        //        if (Status == 1)
        //        {
        //            return "等待分类";
        //        }
        //        if (Status == 6)
        //        {
        //            return "已合并等待采购";
        //        }
        //        if (Status == 5)
        //        {
        //            return "采购完成";
        //        }
        //        return "已合并等待采购";
        //    }
        //}
    }
}
